﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;

namespace www.coursera.algo.org.ProblemQuestion._1
{
    class Program
    {
        static void Main(string[] args)
        {
            List<double> sortArray = new List<double>();
            using (StreamReader sr = new StreamReader("IntegerArray.txt"))
            {
                String line;
                // Read and display lines from the file until the end of
                // the file is reached.
                while ((line = sr.ReadLine()) != null)
                {
                    sortArray.Add(Convert.ToDouble(line));
                    //Console.WriteLine(line);
                }
            }
            Console.WriteLine(sortArray.Count);
            InversionCounter.Sort(sortArray);
            Console.WriteLine(InversionCounter.InversionCount);
            
            Console.ReadLine();
        }
    }
}
